<?php
class TST_Loader extends CI_Loader{
    function widget($name, $params = null){
        $widgetClass = ucfirst($name) . 'Widget';
        include_once(APPPATH . 'widgets/' . $widgetClass . '.php');
        $widget = new $widgetClass;
        $widget->init($params);        
        return $widget->run();
    }
}
?>